<template>
  <div style="display: flex;line-height: 100px">
    <el-dropdown>
      <i class="el-icon-setting" style="margin-right: 15px"></i>
      <el-dropdown-menu slot="dropdown">
        <el-dropdown-item>查看</el-dropdown-item>
        <el-dropdown-item>新增</el-dropdown-item>
        <el-dropdown-item>删除</el-dropdown-item>
      </el-dropdown-menu>
    </el-dropdown>
    <span>王小虎</span>
  </div>
</template>

<script>
export default {
  name: "Header",
  props:{
    icon:String,
  },
  methods:{
    logout(){
      this.$confirm("您确定登出账号？","提示",{
        confirmButtonText:'确定',
        type:'warning',
        center:true,
      })
      .then(()=>{
        this.$message({
          type:'success',
          message:'已登出'
        })
        this.$router.push('/')
      })
      .catch(()=>{
        this.$message({
          type:'info',
          message:'已取消'
        })
      })

    },
    doCollapse(){
      this.$emit('doCollapse')
    }
  }
}
</script>

<style scoped>

</style>